export {}

interface List {
    count: number,
    time: string
}

// let list: Array<List> = []
let arr: Array<List> = JSON.parse(localStorage.getItem('list')||"[]")
let list: List[] = arr

window.addEventListener('load',()=>{
    let time = (new Date()).toLocaleTimeString()
    let count:number = 0
    if(list.length>0){
        count = list[list.length-1].count
    }
    list.push({
        count: count+1,
        time
    })
    localStorage.setItem('list', JSON.stringify(list))
    render(list)
})

function render(arr:Array<List>):void {
    document.body.innerHTML = arr.map(item=>{
        return `<p>刷新次数为：${item.count}，刷新的时间为：${item.time}</p>`
    }).join('')
}